Skip to content

feat!: Add Electrum protocol v1.6 support - #18

Open
noahjoeris wants to merge 7 commits into
bitcoindevkit:masterfrom
noahjoeris:feature/electrum_protocol_v1_6
Open

feat!: Add Electrum protocol v1.6 support#18
noahjoeris wants to merge 7 commits into
bitcoindevkit:masterfrom
noahjoeris:feature/electrum_protocol_v1_6

Conversation

@noahjoeris

Copy link
Copy Markdown

Summary

Add support for Electrum protocol v1.6 methods and response format changes.

  • ServerVersion request type for server.version (version negotiation)
  • EstimateFee gains an optional mode parameter (EstimateFeeMode::{Economical, Conservative})
  • blockchain.block.headers responses support both pre-1.6 (concatenated hex "hex") and v1.6 (list of hex strings "headers") formats
  • BroadcastPackage request type for blockchain.transaction.broadcast_package (package relay)
  • GetMempoolInfo request type for mempool.get_info (replaces blockchain.relayfee)
  • RelayFee retained for pre-1.6 servers
  • Added missing Features to gen_pending_request_types! macro
  • README example updated to GetMempoolInfo

Closes #8
Supersedes #11

Notes to the reviewers

  • I continued Evan's PR. Filled the gaps, fixed issues and addressed the comments.
  • I still need to cleanup the commits. Keeping them now for easier review against the old PR.

evanlinjin and others added 7 commits May 6, 2026 16:27
- Add `ServerVersion` request type (`server.version`)
- Add optional `mode` parameter to `EstimateFee` (breaking: new field)
- Support both pre-1.6 (concatenated hex) and v1.6 (list of hex strings)
  response formats for `blockchain.block.headers`
- Add `BroadcastPackage` request type (`blockchain.transaction.broadcast_package`)
- Add `GetMempoolInfo` request type (`mempool.get_info`)
- Add missing `Features` to `gen_pending_request_types!` macro

Closes bitcoindevkit#8

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Cover both the pre-1.6 concatenated-hex path and the v1.6 array-of-hex
path, asserting they produce equal `Vec<Header>`, plus a sanity check
that non-string/non-array inputs are rejected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Capture rejection details when package broadcast fails, and simplify
broadcast hex encoding with serialize_hex.
mempool.get_info returns required BTC/kvB floats, so deserialize to
FeeRate directly and share conversion with the estimatefee opt helper.
Use blockchain.relayfee in docs and switch the README sample to
GetMempoolInfo for v1.6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update client to support Electrum protocol v1.6 methods

2 participants